<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
<script  src="static/js/artDialog/artDialog.source.js?skin=blue"></script>
<script src="static/js/artDialog/plugins/iframeTools.source.js"></script>
<script src="static/js/ajaxfileupload.js"></script>
<style>
.boxlist li label
  { border: 1px solid #d3dbde;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
    display: inline-block !important;
    float: left !important;
    width: 63px !important;
    text-align: center;
    background:#f2f3f5; 
}
.boxlist li label:hover
  {
	background:#03a9f4;
  	color:#fff; 
  }
a{cursor: pointer;}
.upload{
	
	width:100%;
	float:left;
}
.upload select{
	width:100px;
	float:left;
	margin-left:12px;
}
</style>
    <div class="subnav">
    	<a href="">首页</a> > <a href="">系统管理</a> > logo管理
    </div>
	<div class="main-inner">
		<div class="x-body">
		
			<div class="formlist" style="border:0px;">
				<div class="formbox">
					<h5>PC端logo</h5>
					<ul class="boxlist">
						<li class="fix">
							<div class="upload" >
								<span id="span_img_1"><input type="text" id="pc_logo" disabled name="pc_logo" class="w600" value="{$list[pc_logo][bn_pic]}" > </span> 
								<label>
									上传<input style="display:none;" accept="image/*" type="file" name="pc_logo_file" id="pc_logo_file" onchange="upload_pic('pc_logo');">
								</label>
								<a href="javascript:void(0);" onclick="showPic('pc_logo');" class="formBtn" style="float:left;">图片预览</a>
								<span ><input type="hidden" class="w300" ></span>
							</div>
						</li>
					</ul>
					<br>
					<h5>移动端logo</h5>
					<ul class="boxlist">
						<li class="fix">
							<div class="upload">
								<input type="text" id="mobile_logo" name="mobile_logo" disabled class="w600" value="{$list[mobile_logo][bn_pic]}"> 
								<label>
									上传<input style="display:none;" accept="image/*" type="file" name="mobile_logo_file" id="mobile_logo_file" onchange="upload_pic('mobile_logo');">
								</label>
								<a class="formBtn" href="javascript:void(0);" onclick="showPic('mobile_logo');" style="float:left;">图片预览</a>
							</div>
						</li>
					</ul>
					<br>
					<h5>后台登陆页logo</h5>
					<ul class="boxlist">
						<li class="fix">
							<div class="upload">
								<input type="text" class="w600" name="admin_login_logo"  disabled id="admin_login_logo" value="{$list[admin_login_logo][bn_pic]}"> 
								<label>
									上传<input style="display:none;" accept="image/*" type="file" name="admin_login_logo_file" id="admin_login_logo_file" onchange="upload_pic('admin_login_logo');">
								</label>
								<a class="formBtn" href="javascript:void(0);" onclick="showPic('admin_login_logo');" style="float:left;">图片预览</a>
							</div>
						</li>
				</div>
				<div style="width:100%;margin-top:20px;float:left;" >
					<a class="formBtn active" href="javascript:void(0);" onclick="save();">提交保存</a>
				</div>
			</div>
			
		</div>
	</div>
	<script type="text/javascript">
	//保存
	function save(){
		$.post('',{
			'pc_logo':$("#pc_logo").val(),
			'mobile_logo':$("#mobile_logo").val(),
			'admin_login_logo':$("#admin_login_logo").val(),
			},function (json){
				if(json.status=="1"){ 
					art.dialog.tips('操作成功，已保存!');
				}
			},'json');

		}

	
	//图片预览
        function showPic(path){
        	art.dialog.open("?m=system&c=views&path="+$("#"+path).val(),{title:'图片预览'});
        
        	
        }
	
    	//上传图片
    	function upload_pic(file){
             /* alert(upload_type); */
    		 $.ajaxFileUpload({
    		     url: '?m=system&c=upload&type=upload_type&file='+file+'_file',
    		     fileElementId: file+'_file',
    		     dataType: 'json',
    		     success: function(json){
    		    	 if (json.error == "1"){
    		    		 art.dialog.tips('图片上传失败'); 
    		    	 	}else{
        		    	 	$("#"+file).val(json.url);
    		    	 		art.dialog.tips('图片上传成功');
    		     		}
    		 		}
    	 	});
    	}

    
    		
    </script>		
{template index/footer}
